import { getAllBrandListService } from '@/api/commodity/common';
import { ANALYSIS_STATUS_OPTIONS } from './config';

export const FORM_ITEMS = [
  {
    prop: 'categoryUuids',
    label: '品类',
    type: 'slot',
    slotName: 'category',
    defaultVal: []
  },
  {
    prop: 'skuNo',
    label: 'SKU编码',
    type: 'input',
  },
  {
    prop: 'brandUuid',
    label: '品牌',
    type: 'select',
    remote: true,
    remoteMethod: getAllBrandListService,
    paramKey: 'brandName',
    optionKeys: { valueKey: 'brandUuid', labelKey: 'brandName' },
  },
  {
    prop: 'productName',
    label: '商品名称',
    type: 'input'
  },
  {
    prop: 'spec',
    label: '规格',
    type: 'input'
  },
  {
    prop: 'productBelongHrDeptName',
    label: '商品归属部门',
    type: 'input'
  },
  {
    prop: 'orderQuantity',
    label: '订货数量',
    type: 'range',
    rangeType: 'inputNum',
    precision: 2,
    props: ['orderQuantityStart', 'orderQuantityEnd']
  },
  {
    prop: 'orderQuantity',
    label: '订货频次',
    type: 'range',
    rangeType: 'inputNum',
    props: ['orderFrequencyStart', 'orderFrequencyEnd']
  },
  {
    prop: 'orderAmount',
    label: '订货金额',
    type: 'range',
    rangeType: 'inputNum',
    precision: 2,
    props: ['orderAmountStart', 'orderAmountEnd']
  },
  {
    prop: 'analysisStatus',
    label: '处理状态',
    type: 'select',
    options: ANALYSIS_STATUS_OPTIONS,
    clearable: true,
  }
]

export const TABLE_COLUMNS = [
  {
    title: '阈值标签',
    key: 'analysisTypeStr',
  },
  {
    title: '处理状态',
    key: 'analysisStatusStr',
  },
  {
    title: '暂不开发原因',
    key: 'notDevRemark',
  },
  {
    title: '审核驳回原因',
    key: 'reviewFailRemark'
  },
  {
    title: 'SKU编码',
    key: 'skuNo',
  },
  {
    title: '三级类',
    key: 'categoryLevel3Name',
  },
  {
    title: '四级类',
    key: 'categoryLevel4Name',
  },
  {
    title: '归类名称',
    key: 'classificationName',
  },
  {
    title: '税类代码',
    key: 'taxCateName',
  },
  {
    title: '销售税率',
    key: 'taxRate',
  },
  {
    title: '品牌',
    key: 'brandName',
  },
  {
    title: '商品名称',
    key: 'productName',
  },
  {
    title: '材质',
    key: 'material',
  },
  {
    title: '规格',
    key: 'spec'
  },
  {
    title: '计量单位',
    key: 'unitName',
  },
  {
    title: '区域',
    key: 'areaName'
  },
  {
    title: '商品归属部门',
    key: 'productBelongHrDeptName',
  },
  {
    title: '订货数量',
    key: 'orderQuantity'
  },
  {
    title: '订货频次',
    key: 'orderFrequency'
  },
  {
    title: '订货金额',
    key: 'orderAmount'
  },
]
